<%@page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib uri="TowkerTagLib" prefix="rbac"%>
<%@ taglib uri="/WEB-INF/tags/CommonFunction.tld" prefix="cfn" %>  
<%@include file="/commons/include/html_doctype.html"%>
<html>
<head>
	<title>明细</title>
	<%@include file="/commons/include/getById.jsp" %>
	<script type="text/javascript">
$(function(){
	$('#printInfo').hide();
});
function printBill() {
	$('#printInfo').show();
	$('#mainInfo').hide();
	$(document.body).css('background-color', '#FFFFFF');
	this.print();
	$('#printInfo').hide();
	$('#mainInfo').show();
	$(document.body).css('background-color', '');
}
	</script>
<style type="text/css">
#printInfo { display:block; line-height:25px; }
#mainPTable { border-top:1px solid #000000; border-left:1px solid #000000; }
#mainPTable td { border-bottom:1px solid #000000; border-right:1px solid #000000; padding:2px; }
#rPanel { line-height:20px; }
#rPanel div { margin-bottom:5px; }
</style>
</head>
<body>
<div id="mainInfo">
<table border="0" cellspacing="0" cellpadding="0" class="listLogo">
	<tr>
		<td class="title">入仓单明细</td>
		<td>
			<div class="menuTool">
				<c:if test="${audit=='audit'}">
				<a class="get" href="auditInWarehouse2.htm?keyIndex=${po.id}">审核</a>
				</c:if>
				<c:if test="${acc=='acc'}">
				<a class="get" href="accInWarehouse2.htm?keyIndex=${po.id}">记账</a>
				</c:if>
    <a onClick="printBill()" class="send" href="javascript:void(0);">打印</a>
				<a class="back" onClick="javascript:window.history.back();return false;" href="#">返回</a>
			</div>
		</td>
	</tr>
</table>
<div class="line"></div>
<table border="0" cellspacing="1" cellpadding="0" class="listTable">
	<tr>
		<td class="form_title">入仓单号：</td>
		<td class="form_input">${fn:escapeXml(po.in_warehouse_code)}</td>
	
		<td class="form_title">入仓性质：</td>
		<td class="form_input">
				<c:if test="${po.in_type==1}">产品入库</c:if>
				<c:if test="${po.in_type==2}">材料入库</c:if>
				<c:if test="${po.in_type==3}">自制半成品入库</c:if>
				<c:if test="${po.in_type==4}">采购单入库</c:if> 
		</td>
		<td class="form_title">入库日期：</td>
		<td class="form_input">${cfn:formatDate(po.in_date, 'yyyy-MM-dd')}</td>
	</tr>
	<tr>
	    <td class="form_title">制单时间：</td>
		<td class="form_input">${cfn:formatDate(po.in_time, 'yyyy-MM-dd HH:mm:ss')}</td>
		<td class="form_title">财务统计核算期：</td>
		<td class="form_input">${fn:escapeXml(po.acc_period)}</td>
	
		<td class="form_title">入仓部门：</td>
		<td class="form_input">${fn:escapeXml(dep.dep_name)} ${po.dep_code}</td>
	</tr>
	<tr>
		<td class="form_title">仓库：</td>
		<td class="form_input">${fn:escapeXml(depot.depot_nane)} ${po.depot_code}</td>
	
		<td class="form_title">制单操作员代码：</td>
		<td class="form_input">${fn:escapeXml(po.creater_code)}</td>
		<td class="form_title">所属采购单号：</td>
		<td class="form_input">${fn:escapeXml(po.pur_order_code)}</td>
	
		
	</tr>
	<tr>
	    <td class="form_title">入仓单审核状态：</td>
		<td class="form_input">
		<c:if test="${fn:escapeXml(po.audit_status==0)}">未审核</c:if>
		<c:if test="${fn:escapeXml(po.audit_status==1)}">已审核</c:if>
		</td>
		<td class="form_title">入仓单记账状态：</td>
		<td class="form_input">
		<c:if test="${fn:escapeXml(po.acc_status==0)}">未记账</c:if>
		<c:if test="${fn:escapeXml(po.acc_status==1)}">已记账</c:if>
		</td>
	
		<td class="form_title">生产批次：</td>
		<td class="form_input">${fn:escapeXml(po.seq_id)}</td>
	</tr>
	<tr>
		<td class="form_title">入仓单状态：</td>
		<td class="form_input">
		<c:if test="${fn:escapeXml(po.status==1)}">已审核</c:if>
		<c:if test="${fn:escapeXml(po.status==2)}">已记账</c:if>
		<c:if test="${fn:escapeXml(po.status==3)}">已审核并记账</c:if>
		</td>
	
		<td class="form_title">审核人员代码：</td>
		<td class="form_input">${fn:escapeXml(po.audit_user_code)}</td>
	
		<td class="form_title">供应商代码：</td>
		<td class="form_input">${fn:escapeXml(po.supplier)}</td>
	
		
	</tr>
	<tr>
	<td class="form_title">备注：</td>
		<td colspan="5" class="form_input">${fn:escapeXml(po.remark)}</td>
    </tr>
	<tr>
	  <td class="form_title">入仓产品</td>
	  <td class="form_input" colspan="5">
	  <table width="340" border="0"
						cellpadding="2" cellspacing="1" class="listLogo" id="MGoodsPanel">
						<tr>
							<td>产品代码</td>
							<td>产品名称</td>
							<td>入仓数量</td>
							<td>重量</td>
							<td>计量单位</td>
						</tr>
						<c:forEach items="${refGoods}" var="rg" varStatus="status">
							<tr>
								<td>${rg.goods_sn}<input
									type="hidden" name="ref_id" value="${rg.id}" /> <input
									type="hidden" name="wprice_${rg.goods_id}"
									id="wprice_${rg.goods_id}" value="${rg.wprice}" />
								</td>
								<td>${rg.goods_name} 
								</td>
								<td>
											${rg.amount}
										</td>
								
								
								<td>${rg.weight} 
								</td>
								<td>${rg.unit} 
								</td>
							</tr>
						</c:forEach>
					</table>
      </td>
    </tr>
</table>
</div>
<div id="printInfo">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="4" align="center"><span style="text-decoration:underline;">广州市五羊油漆股份有限公司</span></td>
  </tr>
  <tr>
    <td width="40%">&nbsp;</td>
    <td><h2>材　料　入　仓　单</h2></td>
    <td align="right">NO:<span class="form_input">${fn:escapeXml(po.in_warehouse_code)}</span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>部门：<span class="form_input">${fn:escapeXml(dep.dep_name)} </span></td>
    <td><span class="form_input">${cfn:formatDate(po.in_date, 'yyyy年MM月dd日')}</span></td>
    <td colspan="2">批号：</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" id="mainPTable" height="100%">
      <tr>
          <td>电脑编码</td>
          <td>材料名称</td>
          <td>单位</td>
          <td>数量</td>
          <td>单价</td>
          <td>金额</td>
          <td>备注</td>
          </tr>
        <c:forEach items="${refGoods}" var="rg" varStatus="status">
          <tr>
            <td>${rg.goods_sn}</td>
            <td>${rg.goods_name}</td>
            <td>${rg.unit}</td>
            <td>${rg.amount}</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            </tr>
        </c:forEach>
      </table></td>
    <td align="right" valign="top" id="rPanel">
      <div>白色联<br>车间</div>
      <div>黄色联<br>仓库</div>
      <div>蓝色联<br>财务</div>
      <div>绿色联<br>存根</div>
    </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>验收人：</td>
    <td>入仓人：</td>
    <td>车间负责人：</td>
    <td>制单：<span class="form_input">${fn:escapeXml(po.creater_code)}</span></td>
  </tr>
</table>
</div>
</body>
</html>
